package com.guguskins.back.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 盲盒
 * </p>
 *
 * @author mybatis-plus
 * @since 2021-05-14
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("gu_box")
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class GuBox extends Model<GuBox> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "box_id", type = IdType.AUTO)
    private Long boxId;

    /**
     * 盒子名称
     */
    private String boxName;

    /**
     * 盒子价格
     */
    private BigDecimal boxPrice;

    /**
     * 0 下架 1 上架
     */
    private Integer boxState;

    /**
     * 盒子排序
     */
    private Integer boxSort;

    /**
     * 0 盲盒 1 道具站
     */
    private Integer boxType;

    /**
     * 盒子分类
     */
    private Integer boxCategory;

    /**
     * 盒子背景图
     */
    private String boxImageUrl;

    /**
     * 金蛋
     */
    private Integer boxGoldenEgg;

    /**
     * 银蛋
     */
    private Integer boxSilverEgg;

    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime boxCreateTime;

    /**
     * 更新时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime boxUpdateTime;

    @TableField(exist = false)
    private List<GuGoods> goodsList;

    @TableField(exist = false)
    private List<GuGoods> goodsListCapacity;

    @TableField(exist = false)
    private List<GuGoods> goodsListShow;

    @TableField(exist = false)
    private String goodsIconUrl;

    @JsonIgnore
    @TableField(exist = false)
    private GuGoods goods;

    @TableField(exist = false)
    private GuGoods excludeGoods;

    @TableField(exist = false)
    private Integer id;

    @TableField(exist = false)
    private Integer flag;

    @TableField(exist = false)
    private String cueSameId;

    @TableField(exist = false)
    private Integer isDouble;

    @TableField(exist = false)
    private Integer isWhite;

    @TableField(exist = false)
    private String categoryName;


    @Override
    protected Serializable pkVal() {
        return this.boxId;
    }

}
